import request from '@/utils/request'

// 限制用户信息
 export interface userInfoDate {
  routes:[],
  buttons:[],
  rules:[],
  name:string,
  avatar:string
}

// 限制token
export  interface tokenData {
  token:string
}

// 登录信息限制
export interface loginData {
  username:string,
  password:string
}

//  /admin/acl/index/info
// post /admin/acl/index/login
// post /admin/acl/index/logout 
export default {
  // 获取用户信息
   getUserInfo(){
    return request.get<any,userInfoDate>('/admin/acl/index/info')
  },

  // 登录
  userLogin(logoParams:loginData){
    return request.post<any,tokenData>('/admin/acl/index/login',logoParams)
  },

  // 退出登录
  userLogout(){
    return request.post('/admin/acl/index/logout')
  }

}